Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

313
Views
Error accessing "autoAllocateChunkSize" in PDFJS

i have a new problem after firefox 99 update. I have an extension that reads pdfs using PDFJS (version pdfjs-2.13.216). It always worked and after the last update it started to give: Error: Permission denied to access property "autoAllocateChunkSize" The same extension, with tiny changes, works in chrome normally. Below is the code:

function getAllTextPDF(urlPDF) {
    return new Promise(function (resolve , reject ) {
        var pdfjsLib = this['pdfjs-dist/build/pdf'];  //this because of firefox
        pdfjsLib.GlobalWorkerOptions.workerSrc = '//mozilla.github.io/pdf.js/build/pdf.worker.js';

        var loadingTask = pdfjsLib.getDocument(urlPDF);
        
        //** from that line it no longer enters and generates the mentioned error **
        loadingTask.promise.then(function(pdf) {
            var numPages = pdf._pdfInfo.numPages;
            var textoFinal = '';
            var pagesPromises = [];
          
            for (var i = 0; i < numPages; i++) {                
                (function (pageNumber) {
                    pagesPromises.push(getPageText(pageNumber, pdf));
                })(i + 1);
            }
                            
            Promise.all(pagesPromises).then(function (pagesText) {

                for (var i = 0; i < pagesText.length; i++) {
                    textoFinal += pagesText[i];
                }
                
                if(textoFinal.length > 0){
                    resolve({text: textoFinal});
                    
                    loadingTask.destroy();
                    delete pdfjsLib;
                    delete loadingTask;
                }                   
            });
        
        }, function (reason) {
            // PDF loading error
            reject({reason});
            return 0;
        });
        
    });          
}

example URL of file to read (worked normally):

blob:https://dominio.com/4db038e1-ae8d-4a15-a78f-0d9d0a182c7c

The idea of ​​the method is simple, go through the pdf file and return all the text. However now as mentioned the error is generated. Detail that did not generate the error in version 32bit firefox, I believe it started in the last update of firefox 99.

I appreciate your help.

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!